package module.map.scenes
{
	import drongo.desktop.menu.MenuHelper;
	
	import flash.display.NativeMenu;
	import flash.display.Stage;
	import flash.events.Event;
	
	import module.map.Operations;

	public class SceneMenuHelper
	{
		private static var callBack:Function;
		public function SceneMenuHelper()
		{
			
		}
		
		public static function show(stage:Stage,x:Number,y:Number,p_callBack:Function):void{
			callBack=p_callBack;
			buildMenu();
			menu.addEventListener(Event.SELECT,menuClick);
			menu.display(stage,x,y);
		}
		private static function menuClick(e:Event):void{
			callBack(e);
		}
		private static var menu:NativeMenu;
		public static function buildMenu():void{
			var xml:XML=<item>
							
						</item>
			var addArea:XML=<item/>;
			addArea.@label="新建节点";
			addArea.@value=Operations.NEW_NODE;
			
			xml.appendChild(addArea);
			
			menu=MenuHelper.createByXML(xml);
		}
	}
}